//
//  TodayRightCollectionViewCell.m
//  SYiDaiy
//
//  Created by dllo on 16/9/8.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TodayRightCollectionViewCell.h"
#import "TAMacro.h"


#define kWidth self.bounds.size.width
#define kHeight self.bounds.size.height
@interface TodayRightCollectionViewCell ()

@end
@implementation TodayRightCollectionViewCell




- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.mainImageView = [UIImageView new];
        
      

        _backView = [UIView new];
        _backView.backgroundColor = [UIColor colorWithWhite:0.306 alpha:1.000];
        _backView.alpha = 0.3;
        
        _titleLabel = [UILabel new];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _pubdateLabel = [UILabel new];
        _pubdateLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_mainImageView];
        [_backView addSubview:_titleLabel];
        [_backView addSubview:_pubdateLabel];
        [_mainImageView addSubview:_backView];
    }
    return self;
}


- (void)layoutSubviews
{
    CGRect titleRect = CGRectMake(5,  0, kWidth - 5, 20);
    CGRect pubdateRect = CGRectMake(5,  20, kWidth - 5, 20);
    CGRect backViewRect = CGRectMake(0, kHeight - 40, kWidth, 40);
    
    _mainImageView.frame = self.bounds;
    _titleLabel.frame = titleRect;
    _pubdateLabel.frame = pubdateRect;
    [_backView setFrame:backViewRect];
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

@end
